
	var site ={
		showLogin: function(){
			this.tabPanel('control','php');
		},
		showPassword: function(){
			this.tabPanel('control','php',arguments[0]);
		},
		login: function(){
			this.tabPanel('control','php',arguments[0],arguments[1]);
		},
		logout: function(){
			this.tabPanel('logout','php');
		},
		showVote: function(){
			this.tabPanel('control','php',null,null,'2');
		},
		showReport: function(){
			this.tabPanel('control','php',null,null,'4');
		},
		showReportTop10: function(){
			this.tabPanel('control','php',null,null,'5');
		},
		tabPanel: function(){
			$('backg').style.display='block';
			if(arguments[1]=="php"){
				atributos="";
				for(var i=0;i<=arguments.length-3;i++)
					atributos+="argument"+i+"="+arguments[i+2]+(i==arguments.length-3?"":"&");
				
				new Ajax('items/'+arguments[0]+'.php', {
					method: 'post',
					data: atributos,
					update: $('contenido'),
					evalScripts: true,
					onComplete: function(){
						$('backg').style.display='none';
					}
				}).request();
				
				
			}
			else
				new Ajax('items/'+arguments[0]+'.html', {
					method: 'post',
					update: $('contenido'),
					evalScripts: true,
					onComplete: function(){
						$('backg').style.display='none';
					}
				}).request();
		},
		showReticula: function(){
			this.tabPanel('control','php',null,null,'6');
		},
		sendActions: function(){
			atributos="";
			for(var i=0;i<=arguments.length-1;i++)
				atributos+="argument"+i+"="+arguments[i]+(i==arguments.length-1?"":"&");

			new Ajax('items/actions.php', {
				method: 'post',
				data: atributos,
				evalScripts: true
			}).request();
		}
	};
	
	
	window.addEvent('load', function(){
			site.showLogin();
		}
	);
	

	function import_script(src) {
		var scriptFile = document.createElement('script');
		scriptFile.type = 'text/javascript';
		scriptFile.src = src;
		scriptFile.id = src;
		document.getElementsByTagName('head')[0].appendChild(scriptFile);
	}
